package com.gitee.T5;

import java.util.Scanner;

public class t5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("输入n:");
        int n = sc.nextInt();
        int[] arr = new int[n];
        System.out.println("输入数组:");
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            int count = 0;
            for (int j = 0; j < i; j++) {
                if (arr[j] < arr[i]) {
                    count++;
                }
            }
            System.out.print(count + " ");
        }
    }
}
